package com.kg.module.jtnc.constant;

import com.kg.core.security.util.CurrentUserUtils;
import com.kg.core.zrole.entity.ZRole;
import com.kg.core.zuser.dto.ZUserAllDTO;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 角色常量值
 *
 * @author ziro
 * @date 2024/10/12 17:14
 */
public class RoleConstant {
    /** 农户  */
    public final static String NONGHU = "ROLE_NONGHU";
    /** 技术员 */
    public final static String JISHUYUAN = "ROLE_JISHUYUAN";
    /** 农场主 */
    public final static String NONGCHANGZHU = "ROLE_NONGCHANGZHU";
    /** 合伙人 */
    public final static String HEHUOREN = "ROLE_HEHUOREN";


    /**
     * 判断当前用户，是否是集团总管理员
     *
     * @return true/false
     */
/*    public static boolean isZgly() {
        ZUserAllDTO user = CurrentUserUtils.getCurrentUserAll();
        List<String> roleIds = user.getRoleList().stream().map(ZRole::getRoleId).collect(Collectors.toList());
        return roleIds.contains(ZGLY);
    }*/
}
